import md5
import os,threading
class UrlSeen:
    def __init__(self):
        self._seen=set()
	self._lock=threading.Lock()	
	
    def is_seen(self,strURL,insert=True):
    	self._lock.acquire()
        id=md5.new(str(strURL)).digest()
        
        
	if id in self._seen:
		self._lock.release()
		return True
	else:	
            self._seen.add(id)
	    self._lock.release()
            return False
   	
    def reset(self):
    	self._seen={}
